Function Definition Table

You must supply a definition for each function that you want to add to Crystal Reports. Each entry in the function definition table consists of a definition string that specifies: the return type,

    "returnType UDFName (arg1, arg2,...)", CFunctionName

Here is an example:

"String Picture (String, String)", Picture

In this example:

Note:    The UDFName and the CFunctionName do not have to be the same. You can use something other than the function name to identify a function on the Function list of the Formula Editor if you wish.

All function definitions must be set up in a table with the following heading:

UFFunctionDefStrings FunctionDefStrings [] =

Note:    The table must be terminated with three nulls.

Crystal Reports uses the information you supply in this table to create parameter blocks when you call the functions.

Function definition table example

Here is a sample function definition table for the Picture function:

UFFunctionDefStrings FunctionDefStrings [] = 
{
    {"String Picture(String,String)",Picture},
    {NULL,NULL,NULL}
};

An optional third parameter can be used when you know the maximum length of the return value (or your code can obtain it).

For example, the definition for the Picture function might be:

{"String Picture (String, String)", Picture, PictureRetSize},

Here, PictureRetSize specifies the maximum acceptable length of the string returned by the Picture function.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com